# coding: utf-8
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import BigInteger, Column, DateTime, Integer
from sqlalchemy.schema import FetchedValue

from application import db,app


class MemberAddress(db.Model):
    __tablename__ = 'member_address'
    __table_args__ = (
        db.Index('idx_member_id_status', 'member_id', 'status'),
    )

    id = db.Column(db.Integer, primary_key=True, nullable=False)
    member_id = db.Column(db.Integer, primary_key=True, nullable=False, server_default=db.FetchedValue(), info='??id')
    nickname = db.Column(db.String(40, 'utf8_general_ci'), server_default=db.FetchedValue(), info='nickname')
    mobile = db.Column(db.String(22, 'utf8_general_ci'), server_default=db.FetchedValue(), info='????')
    province_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='province_id')
    province_str = db.Column(db.String(100, 'utf8_general_ci'), server_default=db.FetchedValue(), info='province_str')
    city_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='city_id')
    city_str = db.Column(db.String(100, 'utf8_general_ci'), server_default=db.FetchedValue(), info='city_str')
    area_id = db.Column(db.Integer, server_default=db.FetchedValue(), info='area_id')
    area_str = db.Column(db.String(100, 'utf8_general_ci'), server_default=db.FetchedValue(), info='area_str')
    address = db.Column(db.String(100, 'utf8_general_ci'), server_default=db.FetchedValue(), info='address')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='?????1???0??')
    is_default = db.Column(db.Integer, server_default=db.FetchedValue(), info='????')
    updated_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='????????')
    created_time = db.Column(db.DateTime, server_default=db.FetchedValue(), info='????')
